var maxWidth = 750;
var designWidth = 750;
var initHtmlFont = function() {
	var html = document.documentElement;
	var windowWidth = html.clientWidth > maxWidth ? maxWidth : html.clientWidth;
	html.style.fontSize = (windowWidth / designWidth) * 200 + 'px';
};
initHtmlFont();
var t;
window.onresize = function() {
	clearTimeout(t);
	t = setTimeout(initHtmlFont, 250);
}
document.addEventListener('DOMContentLoaded', function() {
	initHtmlFont();
}, false);

(function(){
    //先判断是否为微信浏览器
    var ua = window.navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
        //重写alert方法，alert()方法重写，不能传多余参数
        window.alert = function(name){
            var iframe = document.createElement("IFRAME");
            iframe.style.display="none";
            iframe.setAttribute("src", 'data:text/plain');
            document.documentElement.appendChild(iframe);
            window.frames[0].window.alert(name);
            iframe.parentNode.removeChild(iframe);
        }
    }
})();